package com.flower.enjoyment.flower.service;

import com.flower.enjoyment.flower.entity.ShopInfo;
import com.flower.enjoyment.flower.entityDo.ServiceTypeDo;
import com.flower.enjoyment.flower.entityDo.ShopImgDo;
import com.flower.enjoyment.flower.entityDo.ShopInfoDo;
import com.flower.enjoyment.flower.entityDo.ShopServiceDo;
import com.github.pagehelper.Page;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ShopService {

    /**
     * 获取推荐商铺列表
     * @return
     */
    List<ShopInfoDo> getCommendShopHomeList();

    /**
     * 获取商铺列表
     * @return
     */
    Page<ShopInfoDo> getCommendShopListByPage(Integer pageNo, Integer pageSize, String lon, String lat);

    /**
     * 店铺详情
     * @param id
     * @return
     */
    ShopInfoDo selectByPrimaryKey(String id);

    /**
     * 申请店铺
     * @param shopInfo
     * @return
     */
    int saveShopInfo(ShopInfo shopInfo,  List<ShopImgDo> imgs)  throws Exception;

    /**
     * 保存图片
     * @param file
     * @param rootSavePath
     * @param rootHttpPath
     * @return
     * @throws Exception
     */
    String saveShopImg(MultipartFile file, String rootSavePath, String rootHttpPath,int type)  throws Exception;

    /**
     * 修改店铺
     * @param shopInfo
     * @return
     * @throws Exception
     */
    int updateShopInfo(ShopInfo shopInfo,List<ShopImgDo> imgs) throws  Exception;

    /**
     * 个人店铺信息
     * @param userId
     * @return
     */
    ShopInfoDo selectByUserId(String userId);

    /**
     * 常用店铺
     * @param pageNo
     * @param pageSize
     * @param userId
     * @return
     */
    Page<ShopInfoDo> selectResortShopListByPage(Integer pageNo, Integer pageSize,String userId);

    /**
     * 获取服务列表
     * @param pageNo
     * @param pageSize
     * @param shopId
     * @return
     */
    Page<ServiceTypeDo> getServiceTypeListByPage(Integer pageNo, Integer pageSize, String shopId);

    /**
     * 获取门店服务项目
     * @param shopId
     * @return
     */
    Page<ShopServiceDo> getShopServiceListByPage(Integer pageNo, Integer pageSize, String shopId);

    /**
     * 保存店铺服务
     * @param shopService
     * @return
     */
    int insertShopService(List<com.flower.enjoyment.flower.entity.ShopService> shopService);

    /**
     * 删除店铺服务
     * @param id
     * @return
     */
    int deleteShopService(String id);

    int selectCountByUserId (String userId);
}
